x86/hvm: Use __initdata_cf_clobber for hvm_funcs
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 14 Feb 2022 12:12:13 +0000 (12:12 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 23 Feb 2022 15:33:43 +0000 (15:33 +0000)
commit8bf7240842c765b6fa13095572aa77c38ff27acf
tree4cc01e7269b334aabe9dbb11e01c7f786b8f7a0c
parent7a7b2be4132d3b96833690ccdb637e339aea6d2e
x86/hvm: Use __initdata_cf_clobber for hvm_funcs

Now that all calls through hvm_funcs are fully altcall'd, harden all the svm
and vmx function pointer targets.  This drops 106 endbr64 instructions.

Clobbering does come with a theoretical risk.  The non-pointer fields of
{svm,vmx}_function_table can in theory happen to form a bit pattern matching a
pointer into .text at a legal endbr64 instruction, but this is expected to be
implausible for anything liable to pass code review.

While at it, move hvm_funcs into __ro_after_init now that this exists.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/vmx/vmx.c